//
//  MYCustomHttp.h
//  demo -- https使用
//
//  Created by 范名扬 on 15/7/2.
//  Copyright (c) 2015年 com.hztc. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol MYCustomHttpDelegate <NSObject>

//网络成功
- (void)customHttp:(char *)receiveData receiveLength:(int)length newQueryTradeType:(int)tradeType;
//网络问题
- (void)customHttp:(NSString *)error;
@end

@interface MYCustomHttp : NSObject<NSURLConnectionDataDelegate,NSURLConnectionDelegate>
@property (nonatomic, weak)id      delegate;
@property (nonatomic, assign)int  nTradeType;
/**
 *  请求数据
 */
+ (void)requestHttp:(id)request urlStr:(char *)urlStr parameters:(char *)parameters length:(int)length newQueryTradeType:(int)tradeType;
/**
 *  取消请求
 */
+ (void)cancelHttpRequest;

+ (void)post:(NSString *)url
      params:(NSDictionary *)params
     success:(void(^)(id response))success
     failure:(void(^)(NSError *error))failure;

@end
